[IA64] set_metaphysical_mode fix
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Wed, 29 Mar 2006 19:41:33 +0000 (12:41 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Wed, 29 Mar 2006 19:41:33 +0000 (12:41 -0700)
If the old mode is metaphysical mode and the new mode is
virtual mode. set_one_rr(0, PSCB(vcpu,rrs[0]) will not
set machine region register 0, because at this time,
PSCB(vcpu,metaphysical_mode) is 1, VMM need to update
metaphysical_mode first, then call set_one_rr.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
xen/arch/ia64/xen/vcpu.c

index 561608873910efd42c01973dca2c6d5336220db5..8bf3bac9af0f3fe7445c3ab6bae9ba819bdacc68 100644 (file)
@@ -172,10 +172,10 @@ void vcpu_set_metaphysical_mode(VCPU *vcpu, BOOLEAN newmode)
 {
        /* only do something if mode changes */
        if (!!newmode ^ !!PSCB(vcpu,metaphysical_mode)) {
+               PSCB(vcpu,metaphysical_mode) = newmode;
                if (newmode) set_metaphysical_rr0();
                else if (PSCB(vcpu,rrs[0]) != -1)
                        set_one_rr(0, PSCB(vcpu,rrs[0]));
-               PSCB(vcpu,metaphysical_mode) = newmode;
        }
 }